
def pythonfunctiondemo():
	str1 = "我是str1";
	return str1;


demo1 = pythonfunctiondemo()
print(demo1);

def pythonFunctionDemo1(num1):
	return num1 * 2;

print(pythonFunctionDemo1("张三李四王二麻子"))
print(pythonFunctionDemo1(123))


def pythonFunctionDemo2(num1):
	print(num1);
	return;

pythonFunctionDemo2(12321)

def pythonFunctionDemo3(num):
	num = 10;
	print('我是pythonFunctionDemo3中的num:',num);
	return;


b = 11;
pythonFunctionDemo3(b);
print(b);


def changeme( mylist ):
   "修改传入的列表"
   mylist.append([1,2,3,4]);
   print("函数内取值: ", mylist)
   return
 
# 调用changeme函数
mylist = [10,20,30];
changeme( mylist );
print("函数外取值: ", mylist)


def pythonFunctionDemo4(num,*num1):
	print(num)
	for x in num1:
	    print(x)
	else:
		print("结束了");
	return
print("-----------")
pythonFunctionDemo4(1,2,3,4,5,6,7,8)

def pythonFunctionDemo5(num,*num1,**num2):
	print(num);
	return;

#函数总结：
#--定义函数使用 def 去定义
#--函数中的形参有 两种方式一种是 一个变量名，一种是不定长变量

def pythonFunctionDemo5(num = 12):
	print(num)
	return;

pythonFunctionDemo5()